package com.uneed.api;

import java.util.ArrayList;

public class RegionApi {
  public static Region[] mainRegionList(Region[] paramArrayOfRegion)
  {
    return subRegionList(paramArrayOfRegion, 0);
  }

@SuppressWarnings("unchecked")
public static Region[] subRegionList(Region[] paramArrayOfRegion, int paramInt)
  {
    Region[] arrayOfRegion = null;
    if (paramArrayOfRegion == null)
    {
      return arrayOfRegion;
    }
    ArrayList localArrayList = new ArrayList();
    int i = paramArrayOfRegion.length;
    for (int j = 0;j<i ; ++j)
    {
      Region localRegion = paramArrayOfRegion[j];
      if (localRegion.parentId() != paramInt)
        continue;
      localArrayList.add(localRegion);
    }
    arrayOfRegion = (Region[])localArrayList.toArray(new Region[localArrayList.size()]);
    return arrayOfRegion;
  }

}